package com.bjqg.greendao;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by bjqg01 on 2018/8/23.
 */

public class SeekHelper extends SQLiteOpenHelper {

    public SeekHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table black_num(_id integer primary key autoincrement, number varchar(20) , mode integer);");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

    public Cursor query(String name) {
        SQLiteDatabase db = this.getReadableDatabase();
        return db.rawQuery("select* from test where name like '%" + name + "%' limit 10",null);
    }
}
